package com.zhanghe.study.action;

import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.dispatcher.HttpParameters;

import java.util.Map;

/**
 * 测试ActionContext
 * @author zh
 * @date 2020/12/21 15:43
 */
public class TestAcAction {

    public String execute(){
        ActionContext actionContext = ActionContext.getContext();
        // 获取application对应的map
        Map<String,Object> application = actionContext.getApplication();
        // 获取seesion对应的map
        Map<String,Object> session = actionContext.getSession();
        // 获取request对应的map
        Map<String,Object> request = (Map<String, Object>) actionContext.get("reuqest");
        HttpParameters paramter = actionContext.getParameters();
        return "success";
    }
}
